package com.thrd.taiexhibition.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.widget.TextView;

import com.facebook.drawee.generic.RoundingParams;
import com.thrd.basicframework.bean.BaseRecyclerAdapter;
import com.thrd.basicframework.utils.DensityUtil;
import com.thrd.taiexhibition.R;
import com.thrd.taiexhibition.bean.BeanInterview;
import com.thrd.taiexhibition.fresco.FrescoImage;
import com.thrd.taiexhibition.fresco.FrescoUtils;

import java.util.List;

/**
 * @author: ${唐杰}
 * @date: 2021/3/31
 */
public class InterviewAdapter extends BaseRecyclerAdapter<BeanInterview> {
    public InterviewAdapter(Context context, List<BeanInterview> data) {
        super(context, data);
    }

    @Override
    public void bindData(BaseViewHolder holder, BeanInterview beanInterview) {
        FrescoImage mImage = (FrescoImage) holder.getView(R.id.fl_image);
        TextView mTitle = (TextView) holder.getView(R.id.tv_title);
        TextView mContent = (TextView) holder.getView(R.id.tv_content);

        FrescoUtils.getInstance().setPrefixProgressLoad(getContext(),mImage,beanInterview.getInterviewImg(), RoundingParams.fromCornersRadius(DensityUtil.dip2px(getContext(),5)));
        mTitle.setText(TextUtils.isEmpty(beanInterview.getInterviewTitle())?"":beanInterview.getInterviewTitle());
        //mContent.setText(TextUtils.isEmpty(beanInterview.getInterviewTitle())?"":beanInterview.getInterviewTitle());
    }

    @Override
    public int getItemLayoutId() {
        return R.layout.item_interview;
    }
}
